package com.zeny.coding.controller.web;


import com.zeny.coding.constants.CourseConstants;
import com.zeny.coding.dto.PageDto;
import com.zeny.coding.dto.Response;
import com.zeny.coding.dto.SmsDto;
import com.zeny.coding.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <h2>手机</h2>
 *
 * @Author Zeny
 */
@SuppressWarnings("all")
@RestController
@RequestMapping("/coding/web/sms")
public class WebSmsController {

    @Autowired
    private SmsService smsService;

    /**
     * <h2>发送验证码并保存到数据库</h2>
     * @param smsDto
     **/
    @PostMapping("/send")
    public Response list(@RequestBody SmsDto smsDto) throws Exception {
        smsService.sendCode(smsDto);
        return new Response().success().message(CourseConstants.QUERY_SUCCESS);
    }
}
